package com.bxd.baodan.mvp.http;

/**
 * Created by lisa on 2016/12/19.
 * Email: 457420045@qq.com
 */

public class HttpMethods {

//    public static final String BASE_URL = JsonApi.path;
//
//    private static final int DEFAULT_TIMEOUT = 8;
//
//    private Retrofit retrofit;
//    private ContentService contentService;
//
//    //构造方法私有
//    private HttpMethods() {
//        //手动创建一个OkHttpClient并设置超时时间
//        OkHttpClient.Builder builder = new OkHttpClient.Builder();
//        M509TrustManager trust = new M509TrustManager();
//        final SSLSocketFactory sslSocketFactory = new SSLSocketFactoryCompat(trust);
//
//        BasicParamsInterceptor basicParamsInterceptor = new BasicParamsInterceptor.Builder()
//                .addHeaderLine("hello:hello")
//                .addQueryParam("deviceId", "12345")
//
//                .build();
//        OkHttpClient  okHttpClient = builder
//                .sslSocketFactory(sslSocketFactory, trust)
//                .addInterceptor(basicParamsInterceptor)
//                .hostnameVerifier(new MyHostnameVerifier())
//                .connectTimeout(DEFAULT_TIMEOUT, TimeUnit.SECONDS)
//                .readTimeout(DEFAULT_TIMEOUT, TimeUnit.SECONDS)
//                .build();
//
//        retrofit = new Retrofit.Builder().client(okHttpClient)
//                .addConverterFactory(GsonConverterFactory.create())
//                .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
//                .baseUrl(BASE_URL)
//                .build();
//
//        contentService = retrofit.create(ContentService.class);
//    }
//
//    //获取单例
//    public static HttpMethods getInstance() {
//        return SingletonHolder.INSTANCE;
//    }
//
//
//    //在访问HttpMethods时创建单例
//    private static class SingletonHolder {
//        private static final HttpMethods INSTANCE = new HttpMethods();
//    }


}